package com.songlin.houxin.common.core.exception;


/**
 * @author jinYuLinLang
 * @version 1.0.0
 * @ClassName BusinessAssert.java
 * @Description <p></p>
 * @createTime 2022-03-09 21:35:00
 */
public class BusinessAssert {
    private BusinessAssert() {
    }

    public static void notNull(Object object, String msg) {
        if (object == null) {
            throw new PigDeniedException(msg);
        }

        if (object instanceof CharSequence) {
            if ("".equals(object)) {
                throw new PigDeniedException(msg);
            }
        }
    }


    public static void isNull(Object object, String msg) {
        if (object != null) {
            throw new PigDeniedException(msg);
        }


    }

    public static void isTrue(boolean flag, String msg) {

        if (!flag) {
            throw new PigDeniedException(msg);

        }
    }


}
